<template>
  <BasicDrawer v-bind="$attrs" @register="registerDrawer" title="身份源模板详情" width="600px">
    <Description :column="1" :data="detailData" @register="registerDescription" />
  </BasicDrawer>
</template>
<script lang="ts" setup>
import {ref, useAttrs} from 'vue';
import {BasicDrawer, useDrawerInner} from '/@/components/Drawer';
import {formDetailSchema} from './data';
import {Description, useDescription} from '/@/components/Description/index';
import {getLdpTmpl} from './api';

const emit = defineEmits(['register']);
const attrs = useAttrs();
const detailData = ref({});
const [registerDescription] = useDescription({
  // data: mockData,
  schema: formDetailSchema,
  labelStyle: {
    marginLeft: '10px',
    width: '90px'
  }
});
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
  setDrawerProps({ confirmLoading: false });
  detailData.value = await getLdpTmpl({code: data.record.code}) ;
});
</script>
